<template>
    <div id="newsList">
        <!-- 页面头部 -->
        <HomePageHead></HomePageHead>
        <!-- 导航栏 -->
        <HomePageNavigation1></HomePageNavigation1>
        <!-- 列表页广告一 -->
        <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
        <!-- 面包屑导航 -->
        <div class="breadcrumb">
            <div class="inner">
                <span class="location">当前位置：</span>
                <el-breadcrumb :separator-icon="ArrowRight">
                    <el-breadcrumb-item>
                        <NuxtLink to="/">首页</NuxtLink>
                    </el-breadcrumb-item>
                    <el-breadcrumb-item>本网招聘</el-breadcrumb-item>
                </el-breadcrumb>
            </div>
        </div>

        <!-- 资讯列表 -->
        <div class="newsList">
            <div class="inner">
                <div class="innerLeft">
                    <div class="innerTitle">本网招聘</div>
                    <ul class="list">
                        <li v-for="(item, index) in newsList" :key="index">
                            <NuxtLink :to="{ path: `zhaopin/${item.id}.html` }" :title="item.con_title">
                                {{ item.con_title }}</NuxtLink>
                        </li>
                    </ul>
                </div>
                <div class="innerRight">
                    <div class="rightMenuTitle">导航列表</div>
                    <ul>
                        <li v-for="(item, index) in bottomMenu" :key="index">
                            <NuxtLink v-if="item.type == 0" :to="`/about/${item.name_pinyin}/index.html`"
                                :title="item.name" :class="item.id == pageId ? 'active' : ''">
                                {{ item.name }}
                            </NuxtLink>
                            <NuxtLink v-else-if="item.type == 1" :to="`/about/${item.name_pinyin}/list-1.html`"
                                :title="item.name" :class="item.id == pageId ? 'active' : ''">
                                {{ item.name }}
                            </NuxtLink>
                        </li>
                    </ul>
                </div>
                <div style="clear: both;"></div>
            </div>
        </div>
        <!-- 列表页广告二 -->
        <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
        <!-- 页面底部 -->
        <HomeFoot1></HomeFoot1>
    </div>
</template>

<script setup>
//1.页面依赖 start ---------------------------------------->
import { ElBreadcrumb, ElBreadcrumbItem, ElPagination } from 'element-plus'
import { ArrowRight } from '@element-plus/icons-vue'
import { ref, onMounted } from 'vue';

//获得跳转过来的id
const route = useRoute();
//获得当前的完整路径
const fullPath = route.path;
//拆分，取出来中间这一段，然后提取数字部分
const segments = fullPath.split('/');
const targetSegment = segments[2];
//const numberPart = targetSegment.match(/\d+$/)?.[0]; 

let articleId;
let pageId;
//通过导航路径反向查询导航id
const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
    method: 'GET',
    query: {
        'foot_pinyin': targetSegment,
    },
});
if (getRouteId.code == 200) {
    articleId = getRouteId.data.id;
    pageId = getRouteId.data.id;
} else {
    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
    console.log("错误位置：通过url路径查询导航池id")
    console.log("后端错误反馈：", getRouteId.message)
    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
}

//1.页面依赖 end ---------------------------------------->

//2.页面数据 start ---------------------------------------->
//广告
let adImg1 = ref([]);
let adImg2 = ref([]);
onMounted(async () => {
    //从客户端获取行政职能部门 加快打开速度
    const { $webUrl, $CwebUrl } = useNuxtApp();
    //广告1
    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0001`
    const responseAd1 = await fetch(url, {
        headers: {
            'Content-Type': 'application/json',
            'Userurl': $CwebUrl,
            'Origin': $CwebUrl
        }
    });
    const resultAd1 = await responseAd1.json();
    adImg1.value = resultAd1.data[0];

    //广告2
    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0002`
    const responseAd2 = await fetch(url2, {
        headers: {
            'Content-Type': 'application/json',
            'Userurl': $CwebUrl,
            'Origin': $CwebUrl
        }
    });
    const resultAd2 = await responseAd2.json();
    adImg2.value = resultAd2.data[0];
})

//左侧导航
const bottomMenu = ref([]);
async function getPageMenu() {
    const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
        method: 'GET',
        query: {},
    });
    bottomMenu.value = mkdata.data;
}
getPageMenu();

//列表
const newsList = ref([]);
let newslists = async () => {
    const listData = await requestDataPromise('/web/getWebsiteFooterCategoryList', {
        method: 'GET',
        query: {
            'fcat_id': pageId,
        },
    });
    newsList.value = listData.data;
}
//获得列表
newslists();
//2.页面数据 end ---------------------------------------->

//3 设置seo信息
const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
    method: 'GET',
    query: {},
});

let seoTitle = setData.data.website_head.title;
let seoDescription = setData.data.website_head.description;
let seoKeywords = setData.data.website_head.keywords;
let seoSuffix = setData.data.website_head.suffix;
let seoName = setData.data.website_head.website_name;

useSeoMeta({
    title: seoTitle + "_" + seoSuffix,
    meta: [
        { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
        { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
        { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
    ]
});
//3.设置seo信息 end---------------------------------------->
</script>

<style lang="less" scoped>
//导航条
.breadcrumb {
    width: 100%;
    height: 22px;
    margin-bottom: 30px;
    font-family: Microsoft YaHei, Microsoft YaHei;
    font-weight: 400;
    font-size: 20px;
    color: #666666;
    line-height: 23px;
    text-align: left;
    font-style: normal;
    text-transform: none;

    :deep(.el-breadcrumb) {
        display: inline-block;
        vertical-align: -4px;
    }

    :deep(.el-breadcrumb__inner a),
    :deep(.el-breadcrumb__inner.is-link) {
        color: #666666;
        font-weight: 400;
        text-decoration: none;
        transition: var(--el-transition-color);
    }

    span {
        font-family: Microsoft YaHei, Microsoft YaHei;
        font-weight: 400;
        font-size: 20px;
        color: #666666;
        line-height: 23px;
        text-align: left;
        font-style: normal;
        text-transform: none;
    }

    span:hover {
        color: #666666;
    }

    .location {
        margin-right: 5px;
        width: 100px;
        height: 22px;
        font-family: Microsoft YaHei, Microsoft YaHei;
        font-weight: 400;
        font-size: 20px;
        color: #666666;
        line-height: 23px;
        text-align: left;
        font-style: normal;
        text-transform: none;
    }
}

// 资讯列表
.newsList {
    width: 100%;
    margin-bottom: 70px;

    .inner {
        width: 1200px;

        .innerLeft {
            font-size: 22px;
            color: #028E21;
            font-weight: bold;
        }

        .innerTitle {
            height: 65px;
            line-height: 65px;
            font-size: 24px;
        }


        .innerLeft {
            float: right;

            >.list {
                height: 570px;
                margin-bottom: 70px;
                border-top: 1px solid #139602;

                >li {
                    width: 790px;
                    height: 60px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    line-height: 60px;
                    //border-bottom: 1px solid #D9D9D9;

                    >a {
                        width: 360px;
                        height: 26px;
                        cursor: pointer;
                        font-family: Microsoft YaHei, Microsoft YaHei;
                        font-weight: 400;
                        font-size: 20px;
                        color: #333333;
                        line-height: 26px;
                        text-align: left;
                        font-style: normal;
                        text-transform: none;
                    }

                }

                >li:hover>a {
                    color: #139602;
                }

                >li:nth-child(1)::after,
                >li:nth-child(2)::after {
                    content: "热";
                    margin-left: 13px;
                    background: #FF8A37;
                    color: #fff;
                    font-size: 14px;
                    padding: 0px 2px;
                }

                >li:nth-child(5n) {
                    border-bottom: 1px solid #D9D9D9;
                }

            }

            >.pagination {
                width: 800px;
                height: 34px;
                margin-left: 141px;
                display: flex;
                justify-content: center;
                margin: 0;

                // 鼠标移入后字体颜色
                .el-pagination::v-deep :hover {
                    color: #139609;
                }

                .el-pagination.is-background::v-deep .btn-next,
                .el-pagination.is-background::v-deep .btn-prev {
                    width: 70px;
                    height: 34px;
                    margin: 0px 10px;
                    border-radius: 4px;
                }

                .el-pagination.is-background::v-deep .el-pager li {
                    margin: 0px 10px;
                    width: 38px;
                    height: 34px;
                    border-radius: 4px;
                }

                .el-pagination.is-background::v-deep .btn-next.is-active,
                .el-pagination.is-background::v-deep .btn-prev.is-active,
                .el-pagination.is-background::v-deep .el-pager li.is-active {
                    background-color: #028e21;
                    color: #fff;
                }


            }
        }

        .innerRight {
            width: 279px;

            .rightMenuTitle {
                width: 279px;
                height: 69px;
                font-size: 22px;
                font-weight: bold;
                line-height: 58px;
                text-align: center;
                color: #fff;
                background: url("http://img.bjzxtw.org.cn/master/bjzxtw/public/special/projectMoreTitle.png") no-repeat;
                margin-bottom: 30px;
            }

            ul {
                li {
                    a {
                        border-left: 5px solid #028E21;
                        margin-bottom: 15px;
                        font-size: 22px;
                        display: block;
                        height: 61px;
                        line-height: 61px;
                        color: #333333;
                        text-align: center;
                        background: #FBFBFB;
                    }
                }
            }

            .active {
                border-left: 0;
                border: 1px solid #028E21;
                background: #fff;
            }
        }
    }
}

//资讯推荐
.zixuntuijian {
    width: 100%;
    height: 290px;
    margin-bottom: 70px;

    .innerLeft {

        // 左侧
        .zixunLeft {
            margin-right: 30px;
        }

        .zixunRight,
        .zixunLeft {
            float: left;
            width: 380px;
            height: 290px;

            // 标题部分
            >.title {
                width: 380px;
            }

            >.title>h3 {
                height: 36px;
                font-family: Source Han Sans, Source Han Sans;
                font-weight: bold;
                font-size: 24px;
                color: #000000;
                line-height: 28px;
                text-align: left;
                font-style: normal;
                text-transform: none;
                border-bottom: 1px solid #139602;

            }

            >.title>h3>span {
                float: right;
                width: 56px;
                height: 20px;
                line-height: 24px;
                font-weight: 400;
                font-size: 14px;
                color: #999999;
                font-style: normal;
                text-transform: none;
            }

            .photo_text {

                >li:first-child {
                    width: 380px;
                    height: 120px;
                    margin-top: 20px;
                    margin-bottom: 15px;
                    position: relative;

                    >img {
                        float: left;
                        width: 160px;
                        height: 120px;
                    }

                    >div {
                        float: left;
                        width: 220px;
                        height: 120px;
                        padding-left: 15px;
                        padding-top: 6px;
                        box-sizing: border-box;
                        background-color: #f6f6f6;


                        >h5 {
                            width: 200px;
                            height: 54px;
                            display: -webkit-box;
                            -webkit-box-orient: vertical;
                            -webkit-line-clamp: 2;
                            overflow: hidden;
                            text-overflow: ellipsis;
                            word-break: break-all;
                            font-family: Source Han Sans, Source Han Sans;
                            font-weight: 500;
                            font-size: 18px;
                            color: #333333;
                            line-height: 26px;
                            text-align: left;
                            font-style: normal;
                            text-transform: none;
                        }

                        >p {
                            width: 200px;
                            height: 22px;
                            line-height: 20px;
                            position: absolute;
                            bottom: 5px;
                            right: 0;

                            >span {
                                display: inline-block;
                                // width: 100px;
                                height: 18px;
                                font-family: Source Han Sans, Source Han Sans;
                                font-weight: 400;
                                font-size: 12px;
                                color: #999999;
                                text-align: left;
                                line-height: 14px;
                                font-style: normal;
                                text-transform: none;
                            }

                            >span:last-child {
                                // width: 90px;
                                text-align: right;
                                margin-left: 20px;
                            }

                        }
                    }
                }

                >li {
                    width: 380px;
                    height: 25px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 500;
                    font-size: 18px;
                    color: #333333;
                    line-height: 21px;
                    text-align: left;
                    font-style: normal;
                    text-transform: none;
                    margin-bottom: 10px;

                    em {
                        display: inline-block;
                        width: 8px;
                        height: 8px;
                        border-radius: 8px;
                        margin-right: 10px;
                        background-color: #d9d9d9;
                    }
                }

                >li:hover {
                    color: #139602;
                }

                >li:hover em {
                    background-color: #139602;
                }
            }
        }
    }

    .innerRight {
        width: 381px;
        height: 290px;
        background-color: #fbfbfb;

        >.title {
            width: 380px;
            height: 40px;
            line-height: 40px;
            border-top: 1px solid #139602;
            border-bottom: 1px solid #e7e7e7;

            >h4 {
                font-family: Microsoft YaHei, Microsoft YaHei;
                font-weight: 400;
                margin-left: 20px;
                font-size: 20px;
                color: #000000;
                text-align: left;
                font-style: normal;
                text-transform: none;

                >span {
                    float: right;
                    font-family: Microsoft YaHei, Microsoft YaHei;
                    font-weight: 400;
                    font-size: 14px;
                    margin-right: 10px;
                    color: #999999;
                    text-align: left;
                    font-style: normal;
                    text-transform: none;
                }
            }

        }

        .rightList {
            height: 540px;
            margin-top: 20px;

            >li {
                height: 100px;
                margin-bottom: 10px;

                >img {
                    width: 150px;
                    height: 100px;
                }

                >p {
                    width: 219px;
                    height: 100px;
                    padding-left: 12px;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 400;
                    font-size: 16px;
                    color: #333333;
                    line-height: 22px;
                    text-align: left;
                    font-style: normal;
                    text-transform: none;

                }

                >p:hover {
                    box-shadow: 0 0 16px 1px rgba(0, 0, 0, 0.1);
                }
            }
        }

    }
}

.projectMoreBox {
    margin: 0 auto;
    height: 540px;
    margin-top: 20px;
    background: url("http://img.bjzxtw.org.cn/master/bjzxtw/public/special/projectMoreBg.png") no-repeat;
    margin-bottom: 40px;

    .projectMoreTitle {
        color: #028E21;
        padding-top: 20px;
        font-size: 26px;
        padding-left: 204px;
    }

    .projectMoreText {
        padding: 40px;
        font-size: 20px;
        color: #333333;
        text-indent: 2em;
        line-height: 36px;
    }
}
</style>


<style lang="less" scoped>


   @media screen and (min-width:801px){/*pc*/

    
    
        .pc_none{display:none;}  
    }        

    @media screen and (max-width:800px){/*ipad_phone*/
        .breadcrumb .inner *{line-height:22px;height:22px;float:left;width:auto;}
        .breadcrumb .inner /deep/.el-icon { line-height:18px;height:18px; width:12px;}

        .breadcrumb{line-height:22px;height:22px;display:block;}
                    .breadcrumb {margin-bottom:11px; }
        .breadcrumb .location{ font-size: 14px; margin-right:5px;}
            .breadcrumb span { font-size: 14px; }

        .newsList .inner{width:92%;}    
        .newsList{margin-bottom:11px;}

        .newsList .inner .innerTitle{font-size:18px;height:50px;line-height:50px;}


        .newsList .inner .innerLeft{width:100%;float:none;}
        .newsList .inner .innerLeft > .list > li{line-height:40px;height:40px;width:100%;width:96%;margin:0px auto;}

        .newsList .inner .innerLeft > .list > li > a{
                    width:92%;display:block; height:40px;line-height:40px;font-size:16px;float:left;
                    word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
                }

         .newsList .inner .innerLeft > .list > li[data-v-b84ebd70]:nth-child(1)::after, .newsList .inner .innerLeft > .list > li[data-v-b84ebd70]:nth-child(2)::after{
            margin-left:0px;font-size:12px;float:right;line-height:16px;height:16px;margin-top:14px;
        }       
     .newsList .inner .innerLeft > .list > li:nth-child(5n){
                height:auto;
                padding-bottom:11px;
                margin-bottom:11px;
            }

            .newsList .inner .innerLeft > .list{height:auto;margin-bottom:11px;}

        .innerRight{display:none;}

    }

 </style>   

